#ifndef LUA_SCRIPT_LOGIC_PROTO
#define LUA_SCRIPT_LOGIC_PROTO

#include "LuaScriptLogic.h"

#include "Vector2.h"
#include <boost/variant.hpp>
#include <map>
#include <string>

namespace EntitySystem
{

class LuaScriptLogicProto : public LuaScriptLogic
{
    typedef boost::variant< int, float, bool, std::string, Math::Vector2F > Attribute;

    typedef std::map< std::string, Attribute > AttributeMap;
    
    
private:
    std::string m_scriptPath;
    
    AttributeMap m_attributes;
public:
    
    LuaScriptLogicProto(const std::string &scriptPath);
    
    ~LuaScriptLogicProto();
    
    
    /**
     * Pushes an attribute for the LuaState. Only copies of this prototype
     * will attain the attribute.
     */
    
    template <class T>
    bool PushAttribute(const std::string&name, const T& value)
    {
	Attribute att = value;
	
	m_attributes.insert( m_attributes.end( ), std::pair< std::string, Attribute >( name, att ) );
	
	return true;
    }
    
    /**
     * Returns a LuaScriptLogic object based on this prototype.
     */ 
    
    virtual ScriptLogic* Clone();
    
    
    virtual void SetParent(Entity *parent);
};

};

#endif